package com.tzinfo.tzt.activity.util;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.tzinfo.tzt.util.VerticalPagerAdapter;
import com.tzinfo.tzt.util.VerticalViewPager;

import java.util.List;

/**
 * Created by Administrator on 2014/11/17.
 */
public class TestAdapter extends VerticalPagerAdapter{

    private Context context;
    ImageLoader image_loader;
    @Override
    public int getCount() {
        return 2;
    }
    public TestAdapter(Context context) {

        super();
        this.context =context;
        image_loader = ImageLoader.getInstance();
        //   this.image_url = url;
    }
    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        ImageView imageView    =    new    ImageView(context);

        ((VerticalViewPager)container).addView(imageView);
        if (position==0){
            image_loader.displayImage("http://www.baidu.com/img/bd_logo1.png",imageView);
        }
        if (position==1){
            image_loader.displayImage("http://img.iknow.bdimg.com/jctuijian/1117/jctj.jpg?t=1416182554",imageView);
        }

        return    imageView;
   //     return super.instantiateItem(container, position);
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {

        return view    ==    object;
    }
}
